// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** addUser POST /api/user/add */
export async function addUserUsingPost(body: API.AddUserDTO, options?: { [key: string]: any }) {
  return request<API.ResultUserVO_>('/api/user/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** getCurrentLoginUser GET /api/user/current */
export async function getCurrentLoginUserUsingGet(options?: { [key: string]: any }) {
  return request<API.ResultUserVO_>('/api/user/current', {
    method: 'GET',
    ...(options || {}),
  });
}

/** deleteUserById DELETE /api/user/delete/${param0} */
export async function deleteUserByIdUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteUserByIdUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultBoolean_>(`/api/user/delete/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** getUserById GET /api/user/get/${param0} */
export async function getUserByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultUserVO_>(`/api/user/get/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** getAllUsers POST /api/user/list */
export async function getAllUsersUsingPost(
  body: API.QueryUserDTO,
  options?: { [key: string]: any },
) {
  return request<API.ResultPageUserVO_>('/api/user/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** getUsersByClassId GET /api/user/list/${param0} */
export async function getUsersByClassIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUsersByClassIdUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultListUserVO_>(`/api/user/list/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** login POST /api/user/login */
export async function loginUsingPost(body: API.LoginDTO, options?: { [key: string]: any }) {
  return request<API.ResultUserVO_>('/api/user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** logout GET /api/user/logout */
export async function logoutUsingGet(options?: { [key: string]: any }) {
  return request<API.ResultString_>('/api/user/logout', {
    method: 'GET',
    ...(options || {}),
  });
}

/** register POST /api/user/register */
export async function registerUsingPost(body: API.RegisterDTO, options?: { [key: string]: any }) {
  return request<API.ResultUserVO_>('/api/user/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** updateUserById POST /api/user/update */
export async function updateUserByIdUsingPost(
  body: API.UpdateUserDTO,
  options?: { [key: string]: any },
) {
  return request<API.ResultUserVO_>('/api/user/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
